#ifndef __OSAL_H
#define __OSAL_H

#ifdef __cplusplus
 extern "C" {
#endif
#include "System.h"

#include "OSAL_Mutex.h"
#include "OSAL_Event.h"
#include "OSAL_Task.h"
#include "OSAL_MemMan.h"

#if(RTOS_TYPE == ENABLE_AZURERTOS)

	#define	OSAL_WaitForever	TX_WAIT_FOREVER	
	#define	OSAL_NoWait			0	
	#define	OSAL_OR_CLEAR		TX_OR_CLEAR	
	#define	OSAL_OR				TX_OR	
	
#elif(RTOS_TYPE == ENABLE_FREERTOS)
	#include "stream_buffer.h"
	
	#define	OSAL_WaitForever	osWaitForever	
	#define	OSAL_NoWait			0	
	#define	OSAL_OR_CLEAR		osFlagsWaitAny	
	#define	OSAL_OR				NULL	
	
	typedef StaticSemaphore_t osStaticMutexDef_t;
	typedef StaticTask_t osStaticThreadDef_t;
	typedef StaticQueue_t osStaticMessageQDef_t;
	typedef StaticTimer_t osStaticTimerDef_t;
	typedef StaticEventGroup_t osStaticEventGroupDef_t;

#else

#endif

#define	OSAL_TOUCH		0x01
#define	OSAL_KEY		0x02

#define	OS_RUNING()		g_ucRuning



void OS_Delay(uint32_t Delay);


	
#ifdef __cplusplus
}
#endif
#endif


